package com.hystrix.command;


import com.hystrix.entity.User;
import com.netflix.hystrix.HystrixCommandGroupKey;
import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
import com.netflix.hystrix.contrib.javanica.command.AsyncResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;


/**
 *自定义处理请求命令
 * */
class UserCozmmand  {

    @Autowired
    private RestTemplate restTemplate;


    @HystrixCommand
    public String getInfo(){

        return restTemplate.getForObject("http://provider-server",String.class);
    }

}
